package es.cazadoresmadridejos.beans.manager.budget.impl;

import java.util.List;

import org.displaytag.pagination.PaginatedList;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;

import es.cazadoresmadridejos.beans.dao.budget.BudgetDao;
import es.cazadoresmadridejos.beans.manager.budget.BudgetManager;
import es.cazadoresmadridejos.common.bean.dao.Dao;
import es.cazadoresmadridejos.common.bean.manager.impl.ManagerImpl;
import es.cazadoresmadridejos.model.Budget;
import es.cazadoresmadridejos.model.BudgetLine;
import es.cazadoresmadridejos.objs.web.Page;

@Service
public class BudgetManagerImpl extends ManagerImpl<Budget> 
	implements BudgetManager{

	@Autowired 
	public void setDao(@Qualifier("budgetDao")
	Dao<Budget> dao) {
		this.dao = dao;
	}

	@Override
	public PaginatedList findAllPaginated(Page page) {
		return ((BudgetDao)dao).findAllPaginated(page);
	}

	@Override
	public List<BudgetLine> getLines(Long budget) {
		return ((BudgetDao)dao).getLines(budget);
	}

	@Override
	public Budget getByReason(Long id) {
		return ((BudgetDao)dao).getByReason(id);
	}

}
